package cn.itcast.config;

import com.fasterxml.jackson.databind.ObjectMapper;
import io.modelcontextprotocol.client.transport.HttpClientSseClientTransport;
import io.modelcontextprotocol.spec.McpClientTransport;
import org.springframework.ai.mcp.client.autoconfigure.NamedClientMcpTransport;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Configuration
public class McpConfig {

//    /**
//     * 百度地图 MCP 服务
//     */
//    @Bean
//    public List<NamedClientMcpTransport> baiduMapMcpClientTransport() {
//        McpClientTransport transport = HttpClientSseClientTransport.builder("https://mcp.map.baidu.com")
//                .sseEndpoint("/sse?ak=SQdSbedKTvX3CJsxYLfJNFpKk5mdjYwA")
//                .objectMapper(new ObjectMapper())
//                .build();
//
//        return List.of(new NamedClientMcpTransport("baiduMap", transport));
//    }

    /**
     * 腾讯地图 MCP 服务
     */
    @Bean
    public List<NamedClientMcpTransport> tencentMapMcpClientTransport() {
        McpClientTransport transport = HttpClientSseClientTransport.builder("https://mcp.map.qq.com")
                .sseEndpoint("/sse?key=Y6VBZ-N4HEN-AFBFX-S3HK3-LZPA6-DCFGY&format=0")
                .objectMapper(new ObjectMapper())
                .build();

        return List.of(new NamedClientMcpTransport("tencentMap", transport));
    }
}
